package com.tcm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tcm.entity.Role;
import com.tcm.entity.dto.param.RoleTeacherUpdateParam;
import com.tcm.entity.resp.PageR;
import com.tcm.entity.vo.RoleSelectResult;
import com.tcm.entity.vo.RoleTeacherListResult;
import com.tcm.exception.DatabaseOperationException;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Guqier
 * @version 1.0
 * @date 2023/7/2 22:22
 */
public interface RoleService extends IService<Role> {
    List<String> getUserRoleKey(Long userId);

    List<RoleSelectResult> getRoleList();

    PageR<RoleTeacherListResult> getTeacherRoleListByPage(Integer page, Integer pageSize, String name, String account);

    @Transactional
    boolean modifyTeacherRole(RoleTeacherUpdateParam param, Long currUserId) throws DatabaseOperationException;

    boolean isAdministrator(Long userId);

    boolean isTeacher(Long userId);
}
